update syntax 1

Documentation Version for Comments and Changes

You are invited to make any changes...add any comments.

Changes will `eventually` be merged into the offical documentation.

Leave any commnents here...

...

... back to index page OE documentation



Formal Syntax

Basics

The syntax of Euphoria is described using a form of BNF notation.

ALPHA ==: ('a' - 'z') | ('A' - 'Z') 
DIGIT ==: ('0' - '9') 
USCORE ==: '_' 
EOL ==: new line character 
 
IDENTIFIER ==: ( ALPHA | USCORE ) [(AlPHA | DIGIT | USCORE) ... ] 
 
EXPRESSION ==: NUMEXPR | STREXPR | SEQEXPR | BOOLEXPR 
 
NUMEXPR ==: (an expression that evaluates to an atom) 
 
STREXPR ==: (an expression that evaluates to a string sequence) 
 
SEQEXPR ==: (an expression that evaluates to an sequence) 
 
BOOLEXPR ==: (an expression that evaluates to an atom in which zero represents  
              falsehood and non-zero represents truth) 
               
BINARYEXPR ==: [ EXPRESSION BINOP EXPRESSION ] 
 
BINOP ==: 'and' | 'or' | 'xor' | '+' | '-' | '*' | '/'  
 
UNARYEXPR ==: [ UNARYOP EXPRESSION ] 
 
UNARYOP ==: 'not' | '-' 
 
STATEMENT ==:  
 
STMTBLK ==: STATEMENT [STATEMENT ...] 
 
LABEL       ==:  'label' STRINGLIT 
 
LISTDELIM   ==:  ',' 
 
STRINGLIT   ==: SIMPLESTRINGLIT | RAWSTRINGLIT 
 
SIMPLESTRINGLIT ==: SSLITSTART [ (CHAR | ESCCHAR) ... ] SSLITEND 
SSLITSTART  ==: '"' 
SSLITEND    ==: '"' 
CHAR        ==: (any byte value) 
ESCCHAR     ==: ESCLEAD ( 't' | 'n' | 'r' | '\' | '"' \ ''') 
ESCLEAD     ==: '\' 
 
RAWSTRINGLIT ==: DQRAWSTRING | BQRAWSTRING 
DQRAWSTRING ==: '"""' [ MARGINSTR ] [CHAR ...] '"""' 
BQRAWSTRING ==: '`' [ MARGINSTR ] [CHAR ...] '`' 
MARGINSTR  ==: '_' ... 
 
SCOPETYPE ==: 'global' | 'public' | 'export' | 'override' 
 
DATATYPE ==: 'atom' | 'integer' | 'sequence' | 'object' | IDENTIFER 

Statements

Directives

INCLUDESTMT
WITHSTMT
NAMESPACE

Variables, Constants, Enums

VARDECLARE

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu